package com;

import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class TestListSelect {

    public static void main(String[] args) {
        MyBatisSqlSessionFactory factory = new MyBatisSqlSessionFactory();
        SqlSession sqlSession = factory.getMyBatisSqlSessionFactory().openSession();
        TestDao testDao = sqlSession.getMapper(TestDao.class);
        System.out.println(testDao);
        
//        查询多条数据
        List<Car> carList = testDao.getListCar();
        System.out.println(carList.size());
        for (Car c: carList) {
            System.out.println(c.getId()+","+c.getName()+","+c.getPrivce());
        }

    }
}
